package day06;

import java.time.LocalDate;
import java.time.format.DateTimeFormatter;
import java.time.temporal.ChronoUnit;
import java.util.Date;

public class Demo6 {
    public static void main(String[] args) {
        String birthday="1997-12-27";
        String death="2100-12-28";
        DateTimeFormatter dtf = DateTimeFormatter.ofPattern("yyyy-MM-dd");
        LocalDate bir = LocalDate.parse(birthday, dtf);
        LocalDate dea = LocalDate.parse(death, dtf);
        long between = ChronoUnit.YEARS.between(bir, dea);
        System.out.println(between);
    }
}
